<?php
echo '<script type="text/javascript">';
require APP . WEBROOT_DIR . DS . "js" . DS . "validate" . DS . "anotation_edit.js";
echo '</script>';
?>
<div id="add_anotation" class="form">
    <fieldset>
        <legend>Agregar Anotación</legend>
        <?php echo $form->create('Anotation', array('id'=>'AnotationPorDiaForm', 'url' => array('controller' => 'anotations', 'action' => 'add')));
        ?>
        <div class="time_range">
            <?php
           echo $this->Form->input('date_from', array('label' => 'Fecha de Inicio', 'div' => array('class' => 'input text required fecha')));
            ?>
            <div class="left">
                <label>Hora de Inicio</label>
                <?php
                echo $this->Form->input('start_hour', array('label' => false, 'type' => 'select', 'options' => $hours));
                ?>
                <span>:</span>
                <?php
                echo $this->Form->input('start_minute', array('label' => false, 'type' => 'select', 'options' => $minutes));
                ?>
            </div>
            <div class="left">
                <label>Hora de Fin</label>
                <?php
                echo $this->Form->input('finish_hour', array('label' => false, 'type' => 'select', 'options' => $hours));
                ?>
                <span>:</span>
                <?php
                echo $this->Form->input('finish_minute', array('label' => false, 'type' => 'select', 'options' => $minutes));
                ?>
            </div>
        </div>
        <?php
        echo $form->input('description', array('type' => 'textarea'));
        echo $form->input('redirigir', array('type' => 'hidden'));
        echo $form->submit(__('Crear', true));
        echo $form->end();
        ?>
    </fieldset>
</div>
<script type="text/javascript" >

    (function($){
        // Date picker
        $("#AnotationDateFrom").datepicker({
            //yearRange: '1970:2010',
            defaultDate: new Date(),
            dateFormat: 'dd/mm/yy',
            changeMonth: true,
            changeYear: true
        });

    })(jQuery);

</script>